package com.sunwayworld.basemodule.rm.train.exampaper.resource;


import com.sunwayworld.basemodule.rm.train.exam.bean.LimsCoreExamBean;
import com.sunwayworld.basemodule.rm.train.exampaper.bean.LimsCoreExamPaperAnswerBean;
import com.sunwayworld.basemodule.rm.train.exampaper.bean.LimsCoreExamPaperAnswerCardDTO;
import com.sunwayworld.basemodule.rm.train.exampaper.bean.LimsCoreExamPaperBean;
import com.sunwayworld.basemodule.rm.train.question.bean.LimsCoreQuestionOptBean;
import com.sunwayworld.basemodule.rm.train.support.constant.LimsTrainPathConstant;
import com.sunwayworld.framework.data.page.Page;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.sunwayworld.framework.data.page.Pagination;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;
import com.sunwayworld.framework.support.activatable.resource.GenericActivatableCloudResource;
import com.sunwayworld.framework.support.base.resource.GenericCloudResource;

@RequestMapping(LimsTrainPathConstant.CORE_EXAM_PAPER_PATH)
public interface LimsCoreExamPaperResource extends GenericCloudResource<LimsCoreExamPaperBean, Long>, GenericActivatableCloudResource<LimsCoreExamPaperBean, Long> {
    
    @RequestMapping(value = "/action/start-exam", method = RequestMethod.PUT)
    LimsCoreExamPaperBean startExam(RestJsonWrapperBean wrapper);
    
    @RequestMapping(value = "/action/end-exam", method = RequestMethod.PUT)
    void endExam(RestJsonWrapperBean wrapper);
    
    @RequestMapping(value = "/{id}/answer-cards/queries", method = RequestMethod.POST)
    Pagination<LimsCoreExamPaperAnswerCardDTO> selectExamPaperAnswerCardByExamPaperId(@PathVariable Long id);
    
    @RequestMapping(value = "/{id}/answers/queries", method = RequestMethod.POST)
    Pagination<LimsCoreExamPaperAnswerBean> selectExamPaperAnswerPaginationByExamPaperId(@PathVariable Long id, RestJsonWrapperBean wrapper);
    
    @RequestMapping(value = "/{id}/answers/{orderNo}", method = RequestMethod.GET)
    LimsCoreExamPaperAnswerBean selectExamPaperAnswerByExamPaperIdAndOrderNo(@PathVariable Long id, @PathVariable Integer orderNo);
    
    @RequestMapping(value = "/answers/{id}", method = RequestMethod.GET)
    LimsCoreExamPaperAnswerBean selectExamPaperAnswerById(@PathVariable Long id);
    
    @RequestMapping(value = "/answers/{answerId}/question-opts/queries", method = RequestMethod.POST)
    Pagination<LimsCoreQuestionOptBean> selectQuestionOptPaginationByAnswerId(@PathVariable Long answerId, RestJsonWrapperBean wrapper);

    @RequestMapping(value = "/submit",method = RequestMethod.POST)
    void submit(RestJsonWrapperBean wrapper);

    @RequestMapping(value = "/action/update-user",method = RequestMethod.POST)
    void updateExamPaperUser(RestJsonWrapperBean wrapper);

    @PostMapping(value = "/search-exampapers")
    Page<LimsCoreExamBean> searchExamPaperCode(RestJsonWrapperBean wrapperBean);
}